1. Field of the Invention
The present invention generally relates to a upsample method, and more particularly, to a method for adaptively selecting filters to interpolate video data.
2. Description of Related Art
With continuing progress and improvement on electronic technology, compact-sized electronic devices such as cellular phones and personal digital assistants (PDAs), have continuously progressed. In current market, electronic devices are integrated with multiple functions so as to enhance their competitiveness. Besides functions of photographing, telephoning and internet surfing, multimedia playback has also become required function of the electronic devices.
In order to provide high performance on multimedia playback, a small System-on-a-Chip (SoC) is disposed in the electronic devices. In the SoC, an audio receiver, an analog-to-digital converter (ADC), a microprocessor, a memory, and an input/output logic are integrated in a single integrated circuit (IC) chip. The Soc is used to encode the multimedia file into standard compression formats such as H.261, H.263, MPEG-1, MPEG-2, and MPEG-4 and also used to interpolate the compressed data when there is a need to play the multimedia file.
When performing video encoding, in order to reduce the amount of data to be processed, the color components of video data is usually transformed from RGB into others. Based on the characteristic of human eyes that is insensitive to color components, the color components of the video data is usually sub-sampled such that only a portion of color information is retained. The common sub-sampling formats includes a 4:2:2 sampling format, a 4:1:1 sampling format, and a 4:2:0 sampling format.
For example, in the process of 4:2:2 sub-sampling for pixels containing color components of R, G, and B, the color components of R, G, and B are equivalently transformed into a luminance Y and color components U and V, and the color components of the pixels are sampled by two. That is, for each two pixels, only the color components of one pixel is sampled and used as the color components of the two pixels.
However, when performing video decoding, no matter what kind of sampling format is used, the sub-sampled color components of video data have to be recovered back to a 4:4:4 sampling format. For example, video data in a 4:2:2 sub-sampling format can be recovered back to the one in the 4:4:4 sub-sampling format by using an averaging filter. To be specific, a pixel on the left and a pixel on the right of a target pixel to be interpolated are averaged and the average value is used as the value of the target pixel. The averaging filter may be suitable for decoding pixels in a smooth area of the video data, but for the pixels in an area having great variation in color components, color blurs may occur by using a single averaging filter. Accordingly, it is necessary to find appropriate filters to be used for decoding the color components of the video data based on the variation in the color components of the video data, so as to remove or reduce the blurs.